package cn.sciento.transfer.infra.datasource.factory;

public final class DataSourceContextHolder {
  private static final ThreadLocal<String> LOOKUP_KEY_HOLDER = ThreadLocal.withInitial(() -> "Default");
  
  public static String getDataSourceLookupKey() {
    return LOOKUP_KEY_HOLDER.get();
  }
  
  public static void setDataSourceLookupKey(String dataSourceLookupKey) {
    LOOKUP_KEY_HOLDER.set(dataSourceLookupKey);
  }
  
  public static void clearDataSourceLookupKey() {
    LOOKUP_KEY_HOLDER.remove();
  }
}
